<template>
	<view class=" dfyuyxert">
		<caidan></caidan>

		<view class="pd  jhbnxerttywwerr" :style="{height:heigjhhs-130+'px'}">
			<view class="fz40 cf b" v-if="showcar">
				{{car.name}}
				<!-- 蓝牙 -->
				<uni-icons type="lanya" class="ml30 cz" color="#fff" size="16" v-if="inicarinfo.blue"></uni-icons> 
				<uni-icons type="lanya" class="ml30 cz" color="#b4a699" size="16" v-if="!inicarinfo.blue"></uni-icons>
				<!-- 卫星颗数 -->
				<text class="ml10 fz40 cz dianhgbe" v-if="SatelliteNum > 0">
					<uni-icons type="weixing" color="#fff" size="18" class="cz"></uni-icons>
					<text style="font-size: 20upx;">x{{SatelliteNum}}</text>
				</text>
				<text class="ml10 fz40 cz dianhgbe" v-if="SatelliteNum == 0">
					<uni-icons type="weixing" color="#b4a699" size="18" class="cz"></uni-icons>
					<text style="font-size: 20upx;color: #b4a699;">x0</text>
				</text>
				<!-- GNSS信号强度 -->
				<!--a+ 1代表 1格信号  以此类推 -->
				<view class="xinhao f_b ml20 " :class="'a'+sig" >
					<text v-for="sd in 5"></text>
				</view>
				<!-- GSM信号强度 -->
				<!--a+ 1代表 1格信号  以此类推 -->
				<!-- <view class="xinhao f_b ml20 " :class="'a'+sig" >
					<text v-for="sd in 5"></text>
				</view> -->
			</view>
			<view class="fz50 cf b" v-else="!showcar">
				无当前车辆
			</view>
			<view class="mt30 row" v-if="showcar">
				<view class="col">
					<view class="mr20 yj jhbjbbjderts" v-if="car.status == 1">
						<text class=" fz26 ">库</text>
					</view>
					<view class="mr20 yj jhbjbbjderts" v-if="car.status == 0">
						<text class=" fz26 ">借</text>
					</view>
					<view class="kkjmnkxert cf fz24">
						{{car.license}}
					</view>
					<view class="ml40 yj jhbjbbjdert" @tap="soscli()">
						<text class=" fz26 ">sos</text>
					</view>
				</view>
				<view class="">
					<uni-icons type="shuaxing" class="ml30 cz" color="#fff" size="16" @tap="getcarstatus(true)"></uni-icons>
				</view>
			</view>
			<view class="mt30 " v-else="showcar==false">
				<view class="kkjmnkxert cf fz24">
					成为车主
				</view>
			</view>
			<view class=" fgfdyderet cen ">
				<text class="jhnmkxertswrr pr" v-if="vehSpeed>0">{{vehSpeed}}km/h</text>
				<view class="jhbjnxert" @tap="hf('vehicleCondition')">
		
<image src="../../static/img/car/car_HeadlightOn.png" mode="widthFix" class="w100 car_yq" v-if="car_HeadlightOn"></image>
<image src="../../static/img/car/car_fshan.png" mode="widthFix" class="w100 car_yq" v-if="car_fshan"></image>
<image src="../../static/img/car/car_weil.png" mode="widthFix" class="w100 car_yq" v-if="car_weil"></image>
<image src="../../static/img/car/car_chuangl1.png" mode="widthFix" class="w100 car_yq" v-if="chaungl1"></image>
<image src="../../static/img/car/car_chuangl2.png" mode="widthFix" class="w100 car_yq" v-if="chuangl2"></image>
<image src="../../static/img/car/car_chuangr1.png" mode="widthFix" class="w100 car_yq" v-if="chuangr1"></image>
<image src="../../static/img/car/car_chuangr2.png" mode="widthFix" class="w100 car_yq" v-if="chuangr2"></image>
<image src="../../static/img/car/car_unlock.png" mode="widthFix" class="w100 car_yq"  v-if="!carlock"></image>
<image src="../../static/img/car/car_lock.png" mode="widthFix" class="w100 car_yq"  v-if="carlock"></image>
<!-- 车门 -->		
<!-- <image src="../../static/img/car/car_doorl1.png" mode="widthFix" class="w100 car_yq"></image> -->
<image src="../../static/img/car/car_doorl1.png" mode="widthFix" class="w100 car_yq" v-if="doorl1"></image>
<!-- <image src="../../static/img/car/car_doorl2.png" mode="widthFix" class="w100 car_yq"></image> -->
<image src="../../static/img/car/car_doorl2.png" mode="widthFix" class="w100 car_yq" v-if="doorl2"></image>
<image src="../../static/img/car/car_doorr2.png" mode="widthFix" class="w100 car_yq" v-if="doorr2"></image>
<image src="../../static/img/car/car_doorr1.png" mode="widthFix" class="w100 car_yq" v-if="doorr1"></image>

<image src="../../static/img/car/car_wei.png" mode="widthFix" class="w100 car_yq" v-if="carwei"></image>
<image src="../../static/img/car/car_yq.png" mode="widthFix" class="w100 car_yq" v-if="yq"></image>
<!-- <image src="../../static/img/car/car_start.png" mode="widthFix" class="w100" ></image> -->
<image src="../../static/img/car/car_start.png" mode="widthFix" class="w100" v-if="ihhhbgsd==0"></image>
<image src="../../static/img/weiqid.png" mode="widthFix" class="w100" v-if="ihhhbgsd==1"></image>
				</view>
			</view>

			<view class=" row pd dsfgysesr ">
				<view class="col">
					<view class="pr f_b pm10">
						<view class="fz24 z6">
							里程表
						</view>
						<view class="mt10 cf fz50" v-if="showcar">
							{{VehOdo}} <text class="z6 fz30 ml10">km</text>
						</view>
						<view class="mt10 cf fz50" v-else="!showcar">
							-- <text class="z6 fz30 ml10">km</text>
						</view>
						<view class="jhimnhmlxet"></view>
					</view>
				</view>
				<view class="col tr">
					<navigator class="pr f_b pm10 tl" url="kongdiao">
						<view class="fz24 z6">
							车内温度
						</view>
						<view class="mt10 cf fz50" v-if="!showcar">
							00.0 <text class="z6 fz30 ml10">℃</text>
							<image src="../../static/img/fengsan.png" mode="widthFix" class="fnegsnaggber ml10"></image>
							
						</view>
						<view class="mt10 cf fz50" v-else="showcar">
							{{temperature}} <text class="z6 fz30 ml10">℃</text>
							<image src="../../static/img/fengsan.png" mode="widthFix" class="fnegsnaggber ml10"  v-if="!airc"></image>
							<image src="../../static/img/fengsanopen.png" mode="widthFix" class="fnegsnaggber ml10"  v-if="airc"></image>
						</view>
						<view class="jhimnhmlxet"></view>
					</navigator>
				</view>
			</view>

			<view class="row mt30 pd pr">
				<view class="col fz36 cf" v-if="showcar">
					{{stTime}}min
					<view class="fz24 z6 mt10">
						启动时间
					</view>
				</view>
				<view class="col fz36 cf" v-else="!showcar">
					--
					<view class="fz24 z6 mt10">
						启动时间
					</view>
				</view>
				<view class="col fz36 cf cen" v-if="showcar">
					{{vehVolt}}V
					<view class="fz24 z6 mt10">
						电压
					</view>
				</view>
				<view class="col fz36 cf cen" v-else="!showcar">
					--
					<view class="fz24 z6 mt10">
						电压
					</view>
				</view>
				<view class="col fz36 cf tr" v-if="showcar">
					良好
					<view class="fz24 z6 mt10">
						引擎状态
					</view>
				</view>
				<view class="col fz36 cf tr" v-else="!showcar">
					--
					<view class="fz24 z6 mt10">
						引擎状态
					</view>
				</view>
			</view>
		</view>

		<view class="">

			<view class="pr">

				<view class="kkjnkknnxsdf mt70 pd" :class="isxianshi?'act':''">
					<view class="sdftyyserteert" style="border-radius: 5px;">
						<view class="kjnklket pr" :class="iskaiqi?'act':''">
							<slider class="pr"  @tap="sfgdyhgwr" @change="sliderChange"  @changing="kjjnnxert" :value="xeetxer"/>
							<view class="jjnkxerttswr cf cen fz28" v-if="!iskaiqi">
								engin start
								<image src="../../static/img/dfdsb.png" class="jhbgggsde cz ml10" mode="widthFix"></image>

							</view>
							<view v-if="iskaiqi" class="kjnmkceert fz28 cf">
								engin stop
								<image src="../../static/img/dsfdsdfdsfa.png" class="jhbgggsde cz ml10" mode="widthFix"></image>
							</view>
						</view>
					</view>
				</view>
				<view class="pd" v-if="isxianshi">

					<view class="row mt20">
						<view class="kjhnkhbnjkhde mr20">
							<view class="fz32 cf">
								车门锁
							</view>
							<view class="mt50 tr">
								<view class="jkjjnjjhhhs f_b">
									<!-- <image src="../../static/img/sdfdsfa.png" mode="widthFix" class="cz" @tap="tihiusd('Cmd_Unlock')"></image> -->
									<image src="../../static/img/sdfdsfa.png" mode="widthFix" class="cz" @tap="sendcoms('Cmd_Unlock')"></image>
								</view>
								<view class="jkjjnjjhhhs f_b ml30">
									<image src="../../static/img/suo.png" mode="widthFix" class="cz" @tap="sendcoms('Cmd_Lock')"></image>
								</view>
							</view>
						</view>
						<view class="col jhjbhjhger">
							<view class="fz32 cf">
								后备箱
							</view>
							<view class="cen mt50" @tap="sendcoms('Cmd_Open_Trunk')">
								<image src="../../static/img/sdfdsf.png" mode="widthFix" class="kijhhjujdr cz"></image>
							</view>
						</view>
					</view>


					<view class="row mt20">
						<view class="col jhjbhjhger ba">
							<view class="fz32 cf">
								车窗
							</view>
							<view class="tr mt20">
								<image src="../../static/img/dsfdsdfa.png" mode="widthFix" class="kjhnnjhhsdrt cz" @touchmove="handletouchmove"
								 @touchstart="handletouchstart('Cmd_Open_Window')" @touchend="handletouchend"></image>
								<image src="../../static/img/xia.png" mode="widthFix" class="kjhnnjhhsdrt cz" @touchmove="handletouchmove"
								 @touchstart="handletouchstart('Cmd_Close_Window')" @touchend="handletouchend"></image>
							</view>
						</view>
						<view class="ml20 jjhnjsdgrrtt">
							<view class="jkkhbbjhbsr row">
								<view class="cf fz32">
									中门
								</view>
								<view class="col">
									<image src="../../static/img/sdfsdsdfa.png" mode="widthFix" class="kjnmkjnnxert cz" @tap="mittertor"></image>
									<image src="../../static/img/men.png" mode="widthFix" class="kjnmkjnnxert cz" @tap="mittertor"></image>
								</view>
							</view>
							<view class="jkkhbbjhbsr  mt20 pr" @tap="getlocation">
								<view class="cf fz32">
									实时位置
								</view>
								<view class="dian z9 fz28 mt20">
									<!-- 济南市高新区舜华街... -->
								</view>
								<uni-icons type="right" class="jhgbbhgsd" color="#fff"></uni-icons>
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>
		<view class="kkndrertwe" v-if="!isxianshi">
			<view class="" v-if="istype==0" @tap="yanzheng">
				<image src="../../static/img/zhiwen.png" mode="widthFix" class="kkjnmkdert cz"></image>
				<view class="cf fz28 cen">
					指纹触控解锁
				</view>
			</view>
			<view class="" v-if="istype==1" @tap="istype=2">
				<image src="../../static/img/icon-system-fi-lock.png" mode="widthFix" class="kkjnmkdert cz ab"></image>
				<view class="cf fz28 cen">
					点击输入密码解锁
				</view>
			</view>

			<view class="cf fz28 pt80" v-if="istype==2">
				<!-- <view class="cf fz28 cen pt20">
					输入密码
				</view> -->
				<input type="number" password="" value="" placeholder="请输入输入密码" focus @input="wanxeer" />
			</view>
 
			<view class="cf fz28 pt80" v-if="istype==3" @touchstart="jjhnjjsr" @touchend="kjnkxeert">
				<!-- <slider activeColor="#373B48" backgroundColor="#ff5500" block-color="#32CC00" class="pr"  @tap="sfgdyhgwr" @change="sliderChange"  @changing="kjjnnxert" :value="xeetxer"/> -->
				右滑解锁
				<image src="../../static/img/xiayibu.png" mode="widthFix" class="kkmmjxweert ml50"></image>
				<image src="../../static/img/xiayibu.png" mode="widthFix" class="kkmmjxweert"></image>
				
			</view>
		</view>
	</view>
</template>
<script>
	import APPUpdate, { getCurrentNo } from "@/js_sdk/zhouWei-APPUpdate/APPUpdate/index.js";
	import caidan from '@/components/knd/caidan'
	// var jsModule = uni.requireNativePlugin("MyModule")
	export default {
		data() {
			return {
				heigjhhs: 0,
				xeetxer: 0,
				iskaiqi: false, // 是否开启
				ihhhbgsd: 1,
				isxianshi: false,
				carkeysstatus: 0, // 副钥匙状态/启用禁用
				car: "",
				isqiehuan: false, // 切换到后台 防止卡屏   true为切换后台了
				time: '',
				isdffg: 0, // 解锁滑动的初始位置
				istype: 3 ,// 0指纹  1密码 2 输入密码 3.右滑动 默认滑动解锁
				lockpass:'',
				setpass:6666,
				isclils:false,
				showcar:false,
				carstatusinit:{},
				isshowadd:false,
				inicarinfo:{
					blue:false, // 蓝牙
					signal:0, // gps信号
					gos:0, // 卫星数量
					remote:true  //远程链接
				},
				version: "" ,// 版本号
				schanageing:false,
				sendcomrres:false,
				changestart:0,
				carlock:true,
				SatelliteNum:0,
				vehVolt:0,
				sig:0,
				yq:false,
				carwei:false,
				chaungl1:false,
				chuangl2:false,
				chuangr1:false,
				chuangr2:false,
				doorl1:false,
				doorl2:false,
				doorr1:false,
				doorr2:false,
				airc:false,
				car_HeadlightOn:false,
				car_fshan:false,
				car_weil:false,
				temperature:'0.00',
				StateIsDoorLock:false,
				carstatusinitgps:{},
				VehOdo:0,
				vehSpeed:0,
				GnssLat:0, //纬度 
				GnssLon:0, //经度
				GnssDirection:false,
				stTime:0 // 启动时间
			}
		},
		components: {
			caidan
		},
		onBackPress() {
			// this.istype = 0
			if(this.istype == 0){
				this.yanzheng()
			}
			
		}, 
		onHide: function() { //页面离开触发  销毁触发
			// this.istype = 3
			this.isxianshi = false 
		},
		onLoad() {
			// APP升级
			APPUpdate();
	// this.dqRegisterInitProject(46,
	// 	(rets) => {
	// 		uni.showToast({
	// 			title: '设备注册用户',
	// 			icon:"none"
	// 		});
	// })
	// this.dqRegisterInitProject(58,
	// 	(rets) => {
	// 		uni.showToast({
	// 			title: '设备注册用户',
	// 			icon:"none"
	// 		});
	// })
	// 注册用户
	// setTimeout(function(){
	//  that.dqRegisterInitProject(46,(e)=>{
	// 	 uni.showModal({
	// 	 	content:JSON.stringify(e)
	// 	 })
	// })
	// that.dqRegisterInitProject(47,
	// 	(rets) => {
	// 		uni.showToast({
	// 			title: '设备注册用户',
	// 			icon:"none"
	// 		});
	// })
	// },8000)
			
			this.heigjhhs = uni.getSystemInfoSync().windowHeight
			
			let that = this
			// 监听切换其他的app了 
			plus.globalEvent.addEventListener("pause", function() {
				that.isqiehuan = true
			})
			
			// 监听车辆初始化回调状态
			uni.$on('carstatus', function(params) {
				// let that =this
				// uni.showToast({
				// 	title: params.message,
				// 	icon: "none"
				// })
				if(params.hasOwnProperty('data')){
					
				if(params.data.type == 1){
					// 蓝牙或者远程的实时状态
					if(params.data.state == 1){
						// 蓝牙连接
					}else{
						// 远程连接
						
					}
				}else if(params.data.type == 2){
					// 蓝牙或者远程连接成功回调
					if(params.data.state == 1 && params.data.code == 7){
						// 蓝牙连接成功
						that.inicarinfo.blue = true
						
					}else if(params.data.state == 2 && params.data.code == 1){
						// 远程连接成功
						that.inicarinfo.remote = true
					}
				}
				else if(params.data.type == 3){
					// 蓝牙或者远程连接失败回调
					if(params.data.state == 1 && params.data.code == 6){
						// 蓝牙连接失败重新连接
						that.inicarinfo.blue = false
						// that.inicarinfo.signal = 0
					}else if(params.data.state == 1 && params.data.code == 8){
						// 蓝牙连接断开
						that.inicarinfo.blue = false
						// that.inicarinfo.signal = 0
					}else if(params.data.state == 2 && params.data.code == 2){
						// 远程连接断开
						// that.inicarinfo.remote = false
					}
				}
				else if(params.data.type == 4){
					
					if(params.data.code == 0){
						// uni.showToast({
						// 	title:'授权设备列表'+JSON.stringify(params.data.data),
						// 	icon:"none"
						// })
						// 初始化成功,jar包绑定设备
						that.$store.commit('setisintcar', true)
						// if(that.car.hasOwnProperty('devsn')){
						// 	// if(that.car.devsn){
						// 		that.dqGetDevInfo(that.car.devsn)
						// 		that.$store.commit('setintdevsn',that.car.devsn)
						// 		// that.dqGetDevInfo(that.$store.state.intdevsn)
						// 	// }
						// }
						let newdevsn = that.$store.state.intdevsn // 是否在控制面板
						if(that.car.hasOwnProperty('devsn') && newdevsn !=false){
							// if(that.car.devsn){
								that.dqGetDevInfo(that.car.devsn)
								
								that.getcarstatus()
								that.$store.commit('setintdevsncar',that.car.devsn)
								// 靠近车门解锁
								let autounlk= "autounlk"+that.car.id
								let locks = uni.getStorageSync(autounlk)
								if(locks === false){
									that.dqGetUnlockState(false)
								}else{
									that.dqGetUnlockState(true)
								}
								// that.dqGetDevInfo(that.$store.state.intdevsn)
							// }
						}
						
						// 获取车辆信息
						// that.getcargps()
					}else if(params.data.code == 1){
						
					}else if(params.data.code == 2){
						// 鉴权认证同步车辆信息成功
					}else if(params.data.code == 3){
						// 删除车辆同步车辆信息成功 
					}else if(params.data.code == 4){
						// 过户车辆同步车辆信息成功
					}else if(params.data.code == 5){
						// 绑定设备成功
					}
					
				}
				else if(params.data.type == 5){
					// 初始化失败回调
					// that.$store.commit('setisintcar', false)
					// uni.showModal({
					// 	content: params.data.msg,
					// 	showCancel: false
					// })
				}
				else if(params.data.type == 6){
					uni.hideLoading()
					that.sendcomrres = true
					// 指令回传成功
					if(params.data.code == 129){
						// 开锁成功
						that.player('lock')
						// that.carlock = false
						// uni.showToast({
						// 	title:params.data.msg,
						// 	icon:"none"
						// })
						let jiefang = uni.getStorageSync('jiefang')
						if(jiefang.hasOwnProperty('isset')){
							if(jiefang.isset && jiefang.time>0){
								let paramsjief = {isset:false,time:jiefang.time}
								uni.setStorageSync('jiefang',paramsjief)
								that.sendTimeCom('Cmd_Out_Alarm',jiefang.time)
							}
						}
					}else if(params.data.code == 130){
						// 关锁成功
						that.player('lock')
						
					}else if(params.data.code == 131){
						// 启动
						that.player('startm')
						
					}else if(params.data.code == 132){
						// 熄火
						
					}else if(params.data.code == 133){
						// 开启后备箱
						that.player('opendoor')
						
					}else if(params.data.code == 134){
						// 关闭车窗
						
					}else if(params.data.code == 135){
						// 打开车窗
						
					}else if(params.data.code == 136){
						// 仅开锁不解防
						
					}else if(params.data.code == 137){
						// 同步授权序列号
						
					}else if(params.data.code == 138){
						// 恢复出厂模式
						
					}else if(params.data.code == 139){
						
					}else if(params.data.code == 140){
						
					}else if(params.data.code == 141){
						
					}else if(params.data.code == 142){
						
					}else if(params.data.code == 145){
						// 进入防盗
						
					}else if(params.data.code == 148){
						// 寻车
						that.player('lock')
						
					}else if(params.data.code == 149){
						// 自动解锁
						that.player('lock')
						
					}else if(params.data.code == 150){
						// 自动落锁
						
					}else if(params.data.code == 128){
						// 心跳包
						
						// GnssLat 纬度 远程时才会有
						if(params.data.data.hasOwnProperty('GnssLat')){
							if(params.data.data.GnssLat>0){
								that.GnssLat = params.data.data.GnssLat
							}
						}
						// GnssLat  经度 远程时才会有
						if(params.data.data.hasOwnProperty('GnssLon')){
							if(params.data.data.GnssLon>0){
								that.GnssLon = params.data.data.GnssLon
							}
						}
						if(params.data.state ==2 && that.inicarinfo.blue == true){
							// 蓝牙连接时，远程心跳不处理
							return
						}
						if(params.data.data.hasOwnProperty('GnssNum')){
							that.SatelliteNum = params.data.data.GnssNum
						}
						
						if(params.data.data.hasOwnProperty('GsmSig')){
							 that.rssical(params.data.data.GsmSig)
							// uni.showToast({
							// 	title:'返回信息：'+JSON.stringify(params.data.data),
							// 	icon:"none"
							// })
						}
						if(params.data.data.hasOwnProperty('StateIsPowerOn')){
							// 车辆是否启动
							setTimeout(function(){
								if(params.data.data.StateIsPowerOn){
								// if(params.data.data.StateIsPowerOn ==1 && that.iskaiqi==false){
									that.iskaiqi = true
									that.xeetxer = 100
									that.ihhhbgsd =0
								}else{
								// }else if(params.data.data.StateIsPowerOn ==0 && that.iskaiqi==true){
									that.iskaiqi = false
									that.xeetxer = 0
									that.ihhhbgsd =1
								}
							},100)
						}
						// 引擎盖
						if(params.data.data.hasOwnProperty('StateHoodOpen')){
							if(params.data.data.StateHoodOpen){
								that.yq = true
							}else{
								that.yq = false
							}
						}
						
						// 后备箱
						if(params.data.data.hasOwnProperty('StateBootOpen')){
							if(params.data.data.StateBootOpen){
								that.carwei = true
							}else{
								that.carwei = false
							}
						}
						//  车门zuo1
						if(params.data.data.hasOwnProperty('StateFrontLeftDoorOpen')){
							if(params.data.data.StateFrontLeftDoorOpen){
								that.doorl1 = true
							}else{
								that.doorl1 = false
							}
						}
						//  车门zuo2
						if(params.data.data.hasOwnProperty('StateLeftRearDoorOpen')){
							if(params.data.data.StateLeftRearDoorOpen){
								that.doorl2 = true
							}else{
								that.doorl2 = false
							}
						}
						//  车门you1
						if(params.data.data.hasOwnProperty('StateFrontRightDoorOpen')){
							if(params.data.data.StateFrontRightDoorOpen){
								that.doorr1 = true
							}else{
								that.doorr1 = false
							}
						}
						//  车门you2
						if(params.data.data.hasOwnProperty('StateRightRearDoorOpen')){
							if(params.data.data.StateRightRearDoorOpen){
								that.doorr2 = true
							}else{
								that.doorr2 = false
							}
						}
						
						// 空调是否打开
						if(params.data.data.hasOwnProperty('StateAirConditioner')){
							if(params.data.data.StateAirConditioner){
								that.airc = true
							}else{
								that.airc = false
							}
						}
						// 电压
						if(params.data.data.hasOwnProperty('vehVolt')){
								that.vehVolt = params.data.data.vehVolt.toFixed(2)
						}
						// 里程表
						
						if(params.data.data.hasOwnProperty('VehOdo')){
								that.VehOdo = params.data.data.VehOdo
						}
						// 车速
						
						if(params.data.data.hasOwnProperty('vehSpeed')){
							that.vehSpeed = params.data.data.vehSpeed
						}
						// 启动时间
						if(params.data.data.hasOwnProperty('stTime')){
								that.stTime = that.s_to_hs(params.data.data.stTime)
						}
						// 引擎故障灯
						// if(params.data.data.hasOwnProperty('StateFaultLight')){
						// 	if(params.data.data.StateFaultLight){
						// 		that.airc = true
						// 	}else{
						// 		that.airc = false
						// 	}
						// }
						
						// 空调wendu
						if(params.data.data.hasOwnProperty('temperature')){
							that.temperature = (params.data.data.temperature/100).toFixed(2)
						}
						
						// 车门锁
						if(params.data.data.hasOwnProperty('StateIsDoorLock')){
							if(params.data.data.StateIsDoorLock==1){
								that.carlock = true
							}else{
								that.carlock = false
							}
						}
						// GnssDirection gps方向
						if(params.data.data.hasOwnProperty('GnssDirection')){
							that.GnssDirection = params.data.data.GnssDirection
						}
						// 大灯
						if(params.data.data.hasOwnProperty('StateHeadlightOn')){
							if(params.data.data.StateHeadlightOn){
								that.car_HeadlightOn = true
							}else{
								that.car_HeadlightOn = false
							}
						}
						// 四闪
						if(params.data.data.hasOwnProperty('car_fshan')){
							if(params.data.data.car_fshan){
								that.car_fshan = true
							}else{
								that.car_fshan = false
							}
						}
						// 尾灯
						if(params.data.data.hasOwnProperty('StateIsBrake')){
							if(params.data.data.StateIsBrake){
								that.car_weil = true
							}else{
								that.car_weil = false
							}
						}
						// uni.showToast({
						// 	title:'经度：'+params.data.data.GnssLat+'赋值：'+that.GnssLat+'纬度：'+params.data.data.GnssLon+'赋值：'+that.GnssLon+'返回信息：'+JSON.stringify(params.data.data),
						// 	icon:"none"
						// })
					}else{
						
					}
					
				}else if(params.data.type == 7){
					// (7)指令回传失败
					uni.showToast({
						title:'指令回传失败'+params.data.msg,
						icon:"none"
					})
				}else{
					// (7)指令回传失败
					uni.showToast({
						title:'未知返回'+params.data.msg,
						icon:"none"
					})
				}
			}else{
				uni.showToast({
					title:'错误信息'+params.message,
					icon:"none"
				})
			}
				
			})
		},
		onNavigationBarButtonTap(e) {
			if (e.index == 0) {
				this.$store.state.isxsd = true
			} else {
				uni.navigateTo({
					url: '/pages/information/index'
				})
			}
		},
		methods: {
			clistartbtn(){
				console.log('点击组件');
				return false
			},
			getlocation(){
				// 实时位置
				let that = this
				// that.GnssLon = '36.2'
				// that.GnssLat = '114.32'
				// that.car.devsn = '243654364'
				// that.GnssDirection = '1.56'
				// that.car.license = ''
				if(that.GnssLon== 0 || that.GnssLat == 0){
					uni.showToast({
						title:"暂无位置信息",
						icon:"none"
					})
					return 
				}
				uni.navigateTo({
					url:'/pages/index/RealTimeLocation?Longitude='+that.GnssLon+'&Latitude='+that.GnssLat+'&devsn='+that.car.devsn+'&GnssDirection='+that.GnssDirection+'&license='+that.car.license
				})
			},
			soscli(){
				// 紧急联系人
				let sos=uni.getStorageSync('sos')
				if(!sos.hasOwnProperty('tel')){
					uni.showModal({
						content:"您尚未添加紧急联系人",
						confirmText:"去添加",
						success: function (res) {
						        if (res.confirm) {
						            console.log('用户点击确定');
									uni.navigateTo({
										url:"/pages/zhongjianbtn/aaEmergencyContact"
									})
						        }
						    }
					})
				}else{
					uni.makePhoneCall({
					    phoneNumber: sos.tel //仅为示例
					});
				}
				
			},
			jjhnjjsr(e) {
				this.isdffg = e.changedTouches[0].pageX
			},
			player(name){
				const innerAudioContext = uni.createInnerAudioContext();
				innerAudioContext.autoplay = true;
				innerAudioContext.src = '/static/music/'+name+'.mp3';
				innerAudioContext.onPlay(() => {
				  // console.log('开始播放');
				});
				innerAudioContext.onError((res) => {
					
				});
			},
			kjnkxeert(e) {
				// if (!this.showcar) {
				// 	return
				// }
				// 右滑动了 解锁了
				if (e.changedTouches[0].pageX - this.isdffg > 100) {
					uni.pageScrollTo({
						scrollTop: 0
					})
					this.isxianshi = true
					this.isqiehuan = false
				}
			},
			wanxeer(e) {
				console.log(e.detail);
				console.log(this.setpass);
				if(this.setpass == e.detail.value){
					uni.pageScrollTo({
						scrollTop: 0
					})
					this.isxianshi = true
					this.isqiehuan = false
					this.istype = 1;
				}
			},
			kjjnnxert(e) {
				console.log('changing');
				// if(this.schanageing == false){
				// 	this.changestart = e.detail.value
				// }
				this.schanageing =true
				this.xeetxer = e.detail.value
				if (e.detail.value>=60 && !this.iskaiqi) {
					uni.vibrateLong({
						success: function() {}
					});
				}
				if (e.detail.value<=40 && this.iskaiqi) {
					uni.vibrateLong({
						success: function() {}
					});
				}
			},
			sfgdyhgwr(e){
				console.log('tap');
				let jjhs  = false,
				lkkmsd = 1,
				jindu = 0
				console.log(this.xeetxer);
				if (this.xeetxer>=100){
					lkkmsd = 99
					jindu = 100
				}
				this.xeetxer = lkkmsd
				setTimeout(()=>{
					this.xeetxer = jindu
				},100)
			},
			sliderChange(e) {
				console.log('change');
				let that = this
				if(this.schanageing){
					this.schanageing = false
					let jjhse = 0
					let jjhhsw = ''
					if (e.detail.value > 60) {
						// this.player('startm') 
						
						if(!this.iskaiqi){
							// console.log('+++++');
							jjhhsw = 'Cmd_Start_Up'
							uni.vibrateLong({
								success: function() {}
							});
							this.cswitch(jjhhsw,(res)=>{
								// console.log('滑动回调开启');
								if(res == true){
									// setTimeout(function(){
										if(that.iskaiqi == false){
											that.iskaiqi = true
											jjhse = 100
											that.xeetxer = jjhse
										}
									// },3000)
									
								}else{
									// setTimeout(function(){
										if(that.iskaiqi = true){
											that.iskaiqi = false
											jjhse = 0
											that.xeetxer = jjhse
										}
									// },3000)
								}
							})
							// console.log('指令发送');
						}else{
							// console.log('----');
							that.iskaiqi = true
							that.xeetxer = 100
						}
						
					} else {
						if(this.iskaiqi){
							uni.vibrateLong({
								success: function() {}
							});
							jjhhsw = 'Cmd_Shut_Down'
							this.cswitch(jjhhsw,(res)=>{
								if(res== true){
									jjhse = 0
									that.iskaiqi = false
									that.xeetxer = jjhse
								}else{
									jjhse = 100
									that.iskaiqi = true
									that.xeetxer = jjhse
								}
							})
						}else{
							that.iskaiqi = false
							that.xeetxer = 0
						}
					}
				}else{
					// uni
					return 
				}
				
				
				// this.isclils = false
			},
			yanzheng() {
				if (this.isxianshi) {
					return
				}
				// if (!this.showcar) {
				// 	return
				// }
				let th = this
				uni.startSoterAuthentication({
					requestAuthModes: ['fingerPrint'],
					authContent: '请用指纹解锁',
					success(res) {
						uni.showToast({
							icon: 'none',
							title: '指纹验证成功'
						})
						uni.pageScrollTo({
							scrollTop: 0
						})
						th.isxianshi = true
						th.isqiehuan = false
					},
					fail(err) {
						uni.showModal({
							content: '指纹验证失败',
							showCancel: false
						})
					}
				})
			},
			currentcardata(){
				let ccar = uni.getStorageSync('current')
				if(!ccar){
					this.car = {}
				}else{
					this.car = ccar.data
				}
				this.doings(1)
			},
			async currentcar() {
				 // console.log('1111111111');
				let ccar =await this.get('/api/car/current')
				if(!ccar.data.hasOwnProperty('id') && !this.car.hasOwnProperty('id')){
					if(ccar.data.id == this.car.id){
						return
					}
				}
				this.car = ccar.data
				this.doings(2)
			},
			doings(sdfs){
				let ccar = this.car
				
				if (this.car.hasOwnProperty('devsn')) {
					this.showcar = true
					let newdevsncar = this.$store.state.intdevsncar // 初始化的设备号
					let newdevsn = this.$store.state.intdevsn // 是否在控制面板
					this.carkeysstatus = ccar.carkey_status
					// uni.showModal({
					// 	content:"初始化的设备号"+newdevsncar+'是否在控制面板'+newdevsn+'是否初始化'+this.$store.state.isintcar+'当前车辆的设备号'+ccar.data.devsn
					// })
					// console.log('有数据');
					if(newdevsncar !=ccar.devsn && this.$store.state.isintcar && newdevsn !=false){
						// 切换设备
						// uni.showToast({
						// 	title:"切换了设备",
						// 	icon:"none"
						// })
						// uni.showModal({
						// 	content:"切换了设备------初始化的设备号"+newdevsncar+'是否在控制面板'+newdevsn+'是否初始化'+this.$store.state.isintcar+'当前车辆的设备号'+ccar.data.devsn
						// })
						this.cleardevsn()
						this.delDeviceInfo()
						this.dqGetDevInfo(ccar.devsn)
						this.getcarstatus()
						this.$store.commit('setintdevsncar', ccar.devsn)
						// 靠近车门解锁
						let autounlk= "autounlk"+this.car.id
						let locks = uni.getStorageSync(autounlk)
						if(locks === false){
							this.dqGetUnlockState(false)
						}else{
							this.dqGetUnlockState(true)
						}
					}
					this.$store.commit('currentcars', ccar)
				}else{
					this.delDeviceInfo()
					this.$store.commit('setintdevsncar', false)
					this.$store.commit('currentcars', ccar)
					this.showcar = false
					if(!this.isshowadd){
						this.isshowadd = true
						if(sdfs == 2){
							setTimeout(function(){
								uni.showModal({
									content:'系统检测到您还不是车主，无法使用此功能',
									confirmText:'去添加',
									success:function (res) {
										if (res.confirm) {
											uni.navigateTo({
												url:'/pages/index/AddVehicle'
											})
										} 
									}
								})
							},1500)
						}
					}
				}
				this.initcar()
			},
			mittertor() {
				uni.showToast({
					icon: "none",
					title: '暂无开放此功能'
				})
			},
			cleardevsn() {
				this.inicarinfo.blue = false
				this.inicarinfo.signal = 0
				this.inicarinfo.gos = 0
				this.inicarinfo.remote = true
				this.carlock = true
				this.SatelliteNum = 0
				this.vehVolt = 0
				this.sig = 0
				this.yq = false
				this.carwei = false
				this.chaungl1 = false
				this.chuangl2 = false
				this.chuangr1 = false
				this.chuangr2 = false
				this.doorl1 = false
				this.doorl2 = false
				this.doorr1 = false
				this.doorr2 = false
				this.airc = false
				this.car_HeadlightOn = false
				this.car_fshan = false
				this.car_weil = false
				this.temperature = '0.00'
				this.StateIsDoorLock = false
				this.VehOdo = 0
				this.vehSpeed = 0
				this.GnssLat = 0
				this.GnssLon = 0
				this.GnssDirection = false
				
			},
			handletouchstart(e) {
				this.time = setTimeout(() => {
					this.sendcoms(e)
				}, 3000); //这里设置定时器，定义长按1000毫秒触发长按事件，时间可以自己改，  
				return false;
			},
			sendcoms(e,isstart=false,callback =false) {
				let that = this
				// uni.showToast({
				// 	title:'蓝牙状态：'+that.inicarinfo.blue+'远程状态+'+that.inicarinfo.remote,
				// 	icon:"none"
				// })
				// that.inicarinfo.remote = true
				if(!that.inicarinfo.blue && that.inicarinfo.remote && that.carkeysstatus == 1){
					// 蓝牙未连接，远程连接
					uni.showModal({
						title: '温馨提示',
						content: '确认执行此操作吗？',
						success: function (res) {
							if (res.confirm) {
								uni.showLoading({
									title:"指令传输中"
								})
								if(isstart){
									callback(true)
								}
								if(e == 'Cmd_Start_Up'){
									let hotcar = uni.getStorageSync('hotcar')
									if(hotcar.hasOwnProperty('isset')){
										if(hotcar.isset && hotcar.time>0){
											that.sendTimeCom('Cmd_Start_Up',hotcar.time)
										}else{
											that.sendCom(e)
										}
									}else{
										that.sendCom(e)
									}
								}else{
									that.sendCom(e)
								}
								setTimeout(function(){
									uni.hideLoading()
								},5000)
							} else if (res.cancel) {
								// console.log('用户点击取消');
								if(isstart){
									callback(false)
								}
							}
						}
					});
				}else if(that.inicarinfo.blue && that.carkeysstatus == 1){
					uni.showLoading({
						title:"指令执行中"
					})
					if(isstart){
						callback(true)
					}
					if(e == 'Cmd_Start_Up'){
						let hotcar = uni.getStorageSync('hotcar')
						if(hotcar.hasOwnProperty('isset')){
							if(hotcar.isset && hotcar.time>0){
								that.sendTimeCom('Cmd_Start_Up',hotcar.time)
							}else{
								that.sendCom(e)
							}
						}else{
							that.sendCom(e)
						}
					}else{
						that.sendCom(e)
					}
					 // that.sendCom(e)
					 setTimeout(function(){
					 	uni.hideLoading()
					 },5000)
				}else{
					// 未连接车辆，用户体验操作
					if(isstart){
						callback(true)
					}
					if(that.carkeysstatus == 0){
						uni.showToast({
							title:'副钥匙已被禁用，请联系车主激活',
							icon:"none"
						})
					}else{
						uni.showToast({
							title:'车辆未连接',
							icon:"none"
						})
					}
					 
				}
			},
			cswitch(types,callback) {
				if (types == 'Cmd_Shut_Down') {
					this.ihhhbgsd = 1
				} else {
					this.ihhhbgsd = 0
				}
				this.sendcoms(types,true,(res)=>{
					// console.log(res);
					// console.log('指令回调');
					callback(res)
				})
			},
			handletouchend() {
				clearTimeout(this.time); //清除定时器    
				if (this.time != 0) {
					//处理点击时间  
				}
				return false;
			},
			handletouchmove() {
				clearTimeout(this.time); //清除定时器    
				this.time = 0;
			},
			startSoterAuthenticationFingerPrint() {
				uni.startSoterAuthentication({
					requestAuthModes: ['fingerPrint'],
					challenge: '123456',
					authContent: '请用指纹解锁',
					success(res) {
						console.log(res);
					},
					fail(err) {
						console.log(err);
					},
					complete(res) {
						console.log(res);
					}
				})
			},
			initcar() {
				var that = this
				// uni.showToast({
				// 	title:'是否初始化'+that.$store.state.isintcar+'设备号'+that.car.devsn,
				// 	icon:"none"
				// })
				// uni.showToast({
				// 	title:'用户ID'+that.islogin(),
				// 	icon:"none"
				// })
				if (!that.$store.state.isintcar && that.islogin()) {
					// console.log();
					// 用户登录+车辆jar包初始化+绑定车辆
					// uni.showToast({
					// 	title: '初始化车辆,用户uid' + that.islogin()+'设备号'+that.car.devsn,
					// 	icon:"none"
					// })
					// that.$store.commit('setisintcar', true)
					uni.$emit('carinit', {
						th: that,
						uid: that.islogin()
					})
				}
			},
			 s_to_hs(s){
			    //计算分钟
			    //算法：将秒数除以60，然后下舍入，既得到分钟数
			    var h;
			    h  =   Math.floor(s/60);
			    //计算秒
			    //算法：取得秒%60的余数，既得到秒数
			    s  =   s%60;
			    //将变量转换为字符串
			    h    +=    '';
			    s    +=    '';
			    //如果只有一位数，前面增加一个0
			    h  =   (h.length==1)?'0'+h:h;
			    s  =   (s.length==1)?'0'+s:s;
			    return h+':'+s;
			},
			getcarstatus(reflash=false){
				let that = this
			
				uni.getNetworkType({
				    success: function (res) {
						console.log(res);
						// 无网络拦截请求
						if(res.networkType == 'none'){
							return
						}
						// 网络差,不是手动请求
						if(res.networkType =='2g' && reflash== false){
							return
						}
				if (that.$store.state.isintcar){
					uni.showLoading({})
					// that.sendCom('Cmd_Heart_Beat')
					that.dqVehState(that.car.devsn,(params)=>{
						
						if (Array.prototype.isPrototypeOf(params.data) && params.data.length === 0) {
							uni.hideLoading()
							uni.showToast({
								title:'暂无车况信息',
								icon:"none"
							})
							return
						}
						if(params.data[0].hasOwnProperty('GnssNum')){
							that.SatelliteNum = params.data[0].GnssNum
						}
						
						if(params.data[0].hasOwnProperty('GsmSig')){
							 that.rssical(params.data[0].GsmSig)
						}
						if(params.data[0].hasOwnProperty('StateIsPowerOn')){
							// 车辆是否启动
							setTimeout(function(){
								if(params.data[0].StateIsPowerOn){
								// if(params.data[0].StateIsPowerOn ==1 && that.iskaiqi==false){
									that.iskaiqi = true
									that.xeetxer = 100
									that.ihhhbgsd =0
								}else{
								// }else if(params.data[0].StateIsPowerOn ==0 && that.iskaiqi==true){
									that.iskaiqi = false
									that.xeetxer = 0
									that.ihhhbgsd =1
								}
							},100)
						}
						// 引擎盖
						if(params.data[0].hasOwnProperty('StateHoodOpen')){
							if(params.data[0].StateHoodOpen){
								that.yq = true
							}else{
								that.yq = false
							}
						}
						// 后备箱
						if(params.data[0].hasOwnProperty('StateBootOpen')){
							if(params.data[0].StateBootOpen){
								that.carwei = true
							}else{
								that.carwei = false
							}
						}
						//  车门zuo1
						if(params.data[0].hasOwnProperty('StateFrontLeftDoorOpen')){
							if(params.data[0].StateFrontLeftDoorOpen){
								that.doorl1 = true
							}else{
								that.doorl1 = false
							}
						}
						//  车门zuo2
						if(params.data[0].hasOwnProperty('StateLeftRearDoorOpen')){
							if(params.data[0].StateLeftRearDoorOpen){
								that.doorl2 = true
							}else{
								that.doorl2 = false
							}
						}
						//  车门you1
						if(params.data[0].hasOwnProperty('StateFrontRightDoorOpen')){
							if(params.data[0].StateFrontRightDoorOpen){
								that.doorr1 = true
							}else{
								that.doorr1 = false
							}
						}
						//  车门you2
						if(params.data[0].hasOwnProperty('StateRightRearDoorOpen')){
							if(params.data[0].StateRightRearDoorOpen){
								that.doorr2 = true
							}else{
								that.doorr2 = false
							}
						}
						
						// 空调是否打开
						if(params.data[0].hasOwnProperty('StateAirConditioner')){
							if(params.data[0].StateAirConditioner){
								that.airc = true
							}else{
								that.airc = false
							}
						}
						// 电压
						if(params.data[0].hasOwnProperty('vehVolt')){
								that.vehVolt = params.data[0].vehVolt.toFixed(2)
						}
						// 里程表
						
						if(params.data[0].hasOwnProperty('VehOdo')){
								that.VehOdo = params.data[0].VehOdo
						}
						// 启动时间
						if(params.data[0].hasOwnProperty('stTime')){
								that.stTime = that.s_to_hs(params.data[0].stTime)
						}
						// 车速
						if(params.data[0].hasOwnProperty('vehSpeed')){
							that.vehSpeed = params.data[0].vehSpeed
						}
						// 空调wendu
						if(params.data[0].hasOwnProperty('temperature')){
							that.temperature = (params.data[0].temperature/100).toFixed(2)
						}
						// 车门锁
						if(params.data[0].hasOwnProperty('StateIsDoorLock')){
							if(params.data[0].StateIsDoorLock==1){
								that.carlock = true
							}else{
								that.carlock = false
							}
						}
						// GnssLat 纬度
						if(params.data[0].hasOwnProperty('GnssLat')){
							if(params.data[0].GnssLat>0){
								that.GnssLat = params.data[0].GnssLat
							}
						}
						// GnssLat  经度
						if(params.data[0].hasOwnProperty('GnssLon')){
							if(params.data[0].GnssLon>0){
								that.GnssLon = params.data[0].GnssLon
							}
						}
						// GnssDirection gps方向
						if(params.data[0].hasOwnProperty('GnssDirection')){
							that.GnssDirection = params.data[0].GnssDirection
						}
						// 大灯
						if(params.data[0].hasOwnProperty('StateHeadlightOn')){
							if(params.data[0].StateHeadlightOn){
								that.car_HeadlightOn = true
							}else{
								that.car_HeadlightOn = false
							}
						}
						// 四闪
						if(params.data[0].hasOwnProperty('car_fshan')){
							if(params.data[0].car_fshan){
								that.car_fshan = true
							}else{
								that.car_fshan = false
							}
						}
						// 尾灯
						if(params.data[0].hasOwnProperty('StateIsBrake')){
							if(params.data[0].StateIsBrake){
								that.car_weil = true
							}else{
								that.car_weil = false
							}
						}
						uni.hideLoading()
						if(reflash == true){
							uni.showToast({
								title:"刷新成功",
								icon:"none"
							})
						}
					})
				}
				}
				})
			},
			getcargps(reflash=false){
				let that = this
				if (that.$store.state.isintcar){
					uni.showLoading({})
				
					let param = {}
					let timestamp=(new Date()).getTime()
					timestamp=timestamp.toString()
					console.log(timestamp);
					let nowtimestamp = timestamp.substr(0, timestamp.length - 4);
					let sttimestamp = parseInt(nowtimestamp)-100
					param.devCode = that.car.devsn
					param.startTime = sttimestamp
					param.endTime = nowtimestamp+5
					param.pageIndex = 1
					param.pageSize = 10
					that.dqDeviceGps(param,(e)=>{
						// that.carstatusinitgps = e.data[0]
						
						uni.hideLoading()
						if(reflash){
							uni.showToast({
								title:"刷新成功",
								icon:"none"
							})
						}
						
					})
				}
			},
			rssical(code){
				let sigdata = 0;
				if(code ==99){
					sigdata = 0
				}else if(code ==0){
					sigdata = 1
				}else if(1 <= code && code <=5){
					sigdata = 2
				}else if(5<= code &&  code<=12){
					sigdata = 3
				}else if(11<=code && code<=17){
					sigdata = 4
				}else if(18<=code && code<=32){
					sigdata = 5
				}else{
					sigdata = 5
				}
				this.sig = sigdata
				return sigdata;
			}
		},
		mounted() {
			// this.startSoterAuthenticationFingerPrint()		
		},
		onHide() {
			// console.log('----------------隐藏');
			this.$store.commit('setintdevsn',false)
			// that.$store.state.intdevsn
		},
		onUnload() {
			this.dqDestroy()
		},
		onShow() {
			let that = this
			
			// console.log('++++++++++++++'+that.$store.state.intdevsn);
			// 是否在控制面板
			that.$store.commit('setintdevsn',true)
			// console.log('++++++++++++++'+that.$store.state.intdevsn);
			// let autounlk= "autounlk"+that.car.id
			// let lockss = uni.getStorageSync(autounlk);
			// if(lockss === false){
			// 	console.log('---------------');
			// }else{
			// 	console.log('++++++++++++');
			// }
			// console.log(lockss)
			
			// setTimeout(function(){
			// 	// if(params.data.data.StateIsEngineStarted){
			// 		// that.iskaiqi = true
			// 		// that.xeetxer = 100
			// 		// that.ihhhbgsd =0
			// 	// }else{
			// 		that.iskaiqi = false
			// 		this.xeetxer = 0
			// 		that.ihhhbgsd =1
			// 	// }
			// },4000)
			// 注册用户
			// setTimeout(function(){
				
			//  that.dqRegisterInitProject(34,(e)=>{
			// 	 uni.showModal({
			// 	 	content:JSON.stringify(e)
			// 	 })
			// })
			// },8000)
			// 删除副钥匙
			// setTimeout(function(){
			//  that.dqDelAuthKey('20200831114754000000000000000097',(e)=>{
			// 	 uni.showModal({
			// 	 	content:JSON.stringify(e)
			// 	 })
			// })
			// },8000)
			
			// setInterval(function(){
			// 	let num = Math.ceil(Math.random()*10);
			// 	console.log(num);
			//      that.setpass = num
			// },2000);
			
		
			// console.log(this.$store.state.currentcars);
			// let that = this
			// 使用缓存数据
			this.currentcardata() 
			// 请求云端数据
			this.currentcar()
			// console.log(that.istype);
			// if(this.$store.state.isintcar){
				
			// }
			let locks = uni.getStorageSync('locks')
			
			if(locks){
				this.istype = locks.type
				if(locks.type == 1){
					this.setpass =  locks.vaule
				}
			}
			if(that.istype == 0){
				uni.checkIsSupportSoterAuthentication({
					success(res) {
						// 没有指纹的设备 用密码登录
						if (res.supportMode.length <= 0) {
							that.istype = 3
						}
					}
				})
			}
			// uni.$emit('carinit', {
			// 	th: that,
			// 	uid: that.islogin()
			// })
			// setTimeout(function(){ 
			// 	that.dqDelVehDevice('-460018972',(res)=>{
			// 		if(res.success){
			// 			uni.showModal({
			// 				title: '删除成功！'
			// 			})	
			// 		}else{
			// 			uni.showModal({
			// 				title:res.message
			// 			})
			// 		}
			// 	})
			// },8000)
			// this.$store.state.isopencar=456
			if (!this.$store.state.isintcar && this.islogin()) {
				this.startMacScan()
			}
			// 切换其他app 返回来出来
			if (this.isqiehuan) {
				this.isxianshi = false
				// this.yanzheng()
			}
		}

	}
</script>
<style scoped>
	.dianhgbe {
		position: relative;
		top: -10upx;
	}

	.kkjmnkxert {
		display: inline-block;
		height: 56upx;
		line-height: 56upx;
		background: rgba(53, 60, 81, 1);
		border-radius: 60px;
		padding: 0upx 40upx;
	}

	.jhbjbbjdert {
		width: 68upx;
		height: 68upx;
		display: inline-block;
		text-align: center;
		border: 2upx solid rgba(252, 90, 90, 1);
		border-radius: 50%;
		color: #FC5A5A;
	}
	.jhbjbbjderts {
		width: 58upx;
		height: 58upx;
		line-height: 45upx;
		display: inline-block;
		text-align: center;
		border: 2upx solid rgb(230, 218, 218);
		border-radius: 50%;
		color: #FFFFFF;
	}
	.jhnmkxertswrr {
		font-size: 90upx;
		font-weight: 600;
		background: linear-gradient(to bottom, #434C60, #202435);
		-webkit-background-clip: text;
		color: transparent;
	}

	.jhbjnxert {
		margin-top: 10upx;
		height: 280upx;
	}

	.fnegsnaggber {
		width: 48upx;
	}

	.jhimnhmlxet {
		height: 4upx;
		background: linear-gradient(180deg, rgba(0, 243, 255, 1) 0%, rgba(97, 129, 255, 1) 100%);
		position: absolute;
		left: 0;
		bottom: 0;
		width: 100%;
	}

	.kkjnkknnxsdf {

		position: fixed;
		left: 0;
		bottom: 60upx;
		width: 100%;
		/* #ifdef H5 */
		bottom: 140upx;
		/* #endif */
	}

	.kkjnkknnxsdf.act {
		position: relative;
		bottom: 0;
	}

	.jjhbnkjsd {
		height: 100upx;
		line-height: 100upx;
		background: rgba(230, 230, 230, 1);
		box-shadow: 0px 6upx 12upx rgba(0, 0, 0, 0.16);
		border-radius: 60upx;
	}

	.kjhnkkjxert {
		width: 224upx;
	}

	.jhbgggsde {
		width: 28upx;
	}

	.jhbnjbbxeet {
		color: #fff;
	}

	.jjhbjhbsfda.col {
		background-color: #232A3E;
		color: #fff !important;
	}

	.jjhbjhbsfdb {
		background-color: #fff;
		color: #232A3E;
	}

	.jjhbjhbsfdb.col {

		background: linear-gradient(to right, #1BD5B9, #1689D5);

	}

	.kjhnkhbnjkhde {
		width: 442upx;
		height: 278upx;
		background: rgba(53, 60, 81, 0.8);
		border-radius: 12upx;
		padding: 30upx;
	}

	.jhjbhjhger {
		padding: 30upx 30upx;
		padding-bottom: 0;
		background: rgba(53, 60, 81, 0.8);
		border-radius: 12upx;
	}





	.jkjjnjjhhhs.ab {
		background: #232A3E !important;
	}

	.kijhhjujdr {
		width: 130upx;
	}

	.jhjbhjhger.ba {
		height: 336upx;
	}

	.kjhnnjhhsdrt {
		width: 112upx;
	}

	.jjhnjsdgrrtt {
		width: 442upx;
	}

	.jkkhbbjhbsr {
		height: 158upx;
		background: rgba(53, 60, 81, 0.8);
		border-radius: 12upx;
		padding: 30upx;
		padding-bottom: 0;
	}

	.kjnmkjnnxert {
		width: 88upx;
		margin-left: 55upx;
	}

	.jhgbbhgsd {
		position: absolute;
		right: 20upx;
		top: 60upx;
	}

	.fgfdyderet {
		padding-bottom: 100upx;
	}

	.jhbnxerttywwerr {
		position: sticky;
		left: 0;
		top: 40upx;
		z-index: 2;
		background: #191D29;
		padding-bottom: 80upx;
		/* #ifdef H5 */
		top: 90upx;
		/* #endif */
	}

	.dsfgysesr {
		position: relative;
		z-index: 100;
	}

	.dfyuyxert {
		padding-bottom: 20upx;
	}

	.kkndrertwe {
		position: fixed;
		left: 0;
		bottom: 0;
		width: 100%;
		height: 260upx;
		padding-top: 30upx;
		background-color: rgba(0, 0, 0, 0.6);
		z-index: 100;
		text-align: center;
		/* #ifdef H5 */
		bottom: 88upx;
		/* #endif */
	}

	.kkjnmkdert {
		width: 126upx;
	}

	.kkjnmkdert.ab {
		width: 76upx;
		margin-top: 40upx;
	}

	.kkmmjxweert {
		width: 20upx;
	}
	.kjnmkceert {
		pointer-events: none 
	}
	.car_yq{
		position: absolute;
		
		z-index: 200;
	}
</style>